<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<jsp:useBean id="othhome_message1" scope="session" class="software.Use_user"/>
<jsp:useBean id="othhome_message2" scope="session" class="software.Fri_done"/>
<jsp:useBean id="othhome_message3" scope="session" class="software.Mes_function"/>
 <jsp:useBean id="othhome_message4" class="softdone.Paination" scope="session"/>
<%@ page language="java" import="softdata.Mes_data"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <title>
        我的留言 
    </title>
    </head>
<body>
  <script Language="javascript">
	function openstr1(relId)
	{   
		window.showModalDialog("othmessage_reply_read.jsp?RelId="+relId,window,"dialogWidth=289px;dialogHeight=154px;status=no");
	}
	</script>
    
     
	<%
	int Id1;
	//if(request.getParameter("flag") != null)
	//Id1=request.getParameter("flag");
	//else 
	String IDoth1=session.getAttribute("IDoth").toString();
      Id1=Integer.parseInt(IDoth1);
	String IDseloth1=session.getAttribute("ID").toString();
    int  IDseloth=Integer.parseInt(IDseloth1);
    othhome_message3.setId_Use_Get(Id1);
    othhome_message3.Mes_function_read();
    int k=othhome_message3.get_fun_sum_message();
    List<Mes_data> listnewmessage = new ArrayList();
    %>
    <a href="othhome_main.jsp?IDseloth=<%=IDseloth%>&mk=1"">返回他的主页</a>
     <table width="1200" border="1">
    <%
    if(k==0){
    %>
   <tr><td width="1160">目前还没有留言</td></tr>
   <%
    }
   else if(k>0)
   {
    %>
    <tr align = 'center'>
      <td align="left" colspan="7">我的留言:<%=k%>条</td>
    </tr>
    <tr align = 'center'>
      <td width="700">留言内容</td>
      <td width="88">好友</td>
      <td width="88">留言时间</td>
    </tr>
    <% 
    for(int i=0;i<k;i++)
    {
    listnewmessage.add(othhome_message3.Mes_get_message(i)); 
    }
    othhome_message4.initPageBean(listnewmessage);
   
   %>

       <%if(othhome_message4.isHasPreviousPage())
       out.print("<a href='othhome_message2.jsp?requestPage=previousPage'>上一页</a>"); %>
       <%if(othhome_message4.isHasNextPage())
       out.print("<a href='othhome_message2.jsp?requestPage=nextPage'>下一页</a>"); %>

  	<%-- 分页显示--%>
     <%
         List notes=othhome_message4.getCurrentPageList();
           for(int m=0;m<notes.size();m++)
           { 
            Mes_data note=(Mes_data)notes.get(m);
            othhome_message3.setmessage(note);
            String name =othhome_message1.getName(othhome_message3.getId_Use_Post());
            out.print("<tr align=center height=30>");
             out.print("<td width=259>"+othhome_message3.getCon_Message()+"</td>");
             %>
            <td align = center  width=88><%=name%></td>
            <%out.print("<td width=88>"+othhome_message3.getTim_Message()+"</td>");
            int mark=othhome_message3.Mes_function_check__rel(othhome_message3.getID());
            if(mark!=0)
            {
           %>
            <td><a href="#" onclick="return openstr1(<%=othhome_message3.getID()%>)">我的回复</a></td>
            <%
            }
            else
            {
           %>
            <td>未回复</td>
            <%
            }
            out.print("</tr>");
			}
			}
	  %>
     </table>
</BODY> 
</html>